<?php 
namespace app\admin\model;
use think\Model;
use think\Db;
class Admin extends Model
{
	protected $table = 'admin';
	// 定义自动完成的属性
	protected $createTime = 'regtime';
    protected $updateTime = 'updatetime';
    protected $insert = ['status' => 1];
    // status属性读取器
    protected function getStatusAttr($value)
    {
        $status = [-1 => '删除', 0 => '禁用', 1 => '正常', 2 => '待审核'];
        return $status[$value];
    }
    // level属性读取器
    protected function getLevelAttr($value)
    {
        $status = [1 => '超级管理员', 2 => '网站编辑员', 3 => '客服小秘书', 4 => '仓库管理员'];
        return $status[$value];
    }
}